function db(sql,callback) {
    const mysql = require('mysql')
        const conn = mysql.createConnection({
        host:'localhost',
        user:'root',
        password:'',
        database:'daishijian'
        })
        conn.connect()
        conn.query(sql,callback)
        conn.end()
    }

    module.exports = db

    //调用
    // db('select * from student',(err,result)=>{
    //     if(err) throw err;
    //     console.log(resutl);
    // })
